# - Config file for the @PROJECT_NAME@ package
# It defines the following variables
#  @PROJECT_NAME@_INCLUDE_DIRS - include directories for @PROJECT_NAME@
#  @PROJECT_NAME@_LIBRARIES    - libraries to link against

list(FIND OverallFoundPackages @PROJECT_NAME@ isPackageAlreadyFound)
if(${isPackageAlreadyFound} GREATER -1)
	return()
endif()
 
# Compute the installation prefix relative to this file.
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)

# include all package dependencies
foreach(target @INSTALL_TARGETS@)
	GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
    GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
    
    list(FIND OverallFoundPackages ${target} isPackageAlreadyFound)
	if(${isPackageAlreadyFound} EQUAL -1)
		find_package(${target} REQUIRED CONFIG PATHS ${_IMPORT_PREFIX}/config NO_DEFAULT_PATH)
		
		set(tmp ${OverallFoundPackages})
		list(APPEND tmp ${target})
		set(OverallFoundPackages ${tmp} CACHE INTERNAL "" FORCE)
	endif()
	
	list(APPEND libs ${${target}_LIBRARIES})
	list(APPEND includeDirs ${${target}_INCLUDE_DIRS})
endforeach()	
 
# These are IMPORTED targets created by @PROJECT_NAME@Targets.cmake
set(@PROJECT_NAME@_LIBRARIES ${libs})
unset(libs)
set(@PROJECT_NAME@_INCLUDE_DIRS ${includeDirs})
unset(includeDirs)


